﻿using System.IO;
using Newtonsoft.Json.Linq;
using SpriteAtlasRuntime;

namespace AnimationPackerEngine.Animation.CommandWriters
{
    internal class Label : ICommandWriter
    {
        private string mName;

        internal Label(string name)
        {
            mName = name;
        }

        internal Label(JValue value)
            : this(value.Value as string)
        {
        }

        public void Write(BinaryWriter binaryWriter, IWriterContext context)
        {
            binaryWriter.Write((int)ScriptCommands.Label);
            binaryWriter.Write(mName);
        }
    }
}
